<template>
  <div class="list-card">
    <div class="Attorney-viexy3-vi">
      <div class="Attorney-viexy3-text">
        <div class="Attorney-viexy3-viewljl">
          <div class="Attorney-img">
            {{ itemObj.shortName }}
          </div>
          <div class="Attorney-viexy3-text12">
            <div
              class="Attorney-viexy3-title"
              v-html="deal(itemObj.d2CorpName)"
            ></div>
            <div class="Attorney-viexy3-pap">
              <img
                v-if="itemObj.isparty === 1"
                src="https://djl-zc-suzhou.oss-cn-hangzhou.aliyuncs.com/static/hth_map.png"
                alt=""
              />
              <div
                v-if="itemObj.totalscore"
                class="Attorney-viexy3-pap-score"
                :class="'score_' + itemObj.creditRate"
              >
                {{ itemObj.totalscore }}分
              </div>
              <div
                v-if="itemObj.totalscore"
                class="Attorney-viexy3-pap-level"
                :class="'level_' + itemObj.creditRate"
              >
                {{ itemObj.creditRate }}
              </div>
              <div
                class="Attorney-viexy3-view1"
                v-for="(item, index) in itemObj.labelList"
                :key="index"
                :style="{
                  background: item.backgroundColor,
                  color: item.fontColor
                }"
              >
                {{ item.name }}
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="Attorney-viexy3-viewapo">
        <div>
          <p class="Attorney-name">法定代表人</p>
          <p class="Attorney-name-content">{{ itemObj.d2LegalPer }}</p>
        </div>
        <div>
          <p class="Attorney-name">注册资本</p>
          <p>{{ itemObj.d2Regcap || '-' }}</p>
        </div>
        <div>
          <p class="Attorney-name">成立日期</p>
          <p>{{ itemObj.d2Esdate || '-' }}</p>
        </div>
      </div>

      <div class="Attorney-viexy3-ppoah">
        <img
          src="https://zx-1311146360.cos.ap-shanghai.myqcloud.com/version01/dingwei.png"
        />
        <div>
          <!-- <span v-if="itemObj.distance">距您{{ itemObj.distance }}m｜</span> -->
          <span class="tetxabs">{{ itemObj.d2Dom }}</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'list-card',
  props: {
    itemObj: {
      type: Object,
      default: function () {
        return {};
      }
    },
    keyName: {
      type: String,
      default: ''
    }
  },
  data () {
    return {};
  },
  mounted () { },
  methods: {
    deal (val) {
      if (this.keyName) {
        return val.replace(this.keyName, "<font style='color:red;'>" + this.keyName + '</font>');
      } else {
        return val;
      }
    }
  }
};
</script>
<style lang="scss" scoped>
.Attorney-viexy3-vi {
  padding-top: 17px;
  background-color: #fff;
  // border-bottom: 8px solid rgba(255, 255, 255, 0.6);
  border-bottom: 8px solid #f6f6f6;
  // margin-bottom: 8px;
  border-radius: 8px;
  cursor: pointer;
  .Attorney-viexy3-text {
    display: flex;
    padding: 0 18px 0 18px;
    .Attorney-viexy3-viewljl {
      display: flex;
      .Attorney-img {
        width: 37px;
        height: 37px;
        border-radius: 5px;
        background-color: #d99d9a;
        font-size: 13px !important;
        font-family: Source Han Sans SC;
        color: #ffffff;
        text-align: center;
        line-height: 18px;
        // margin-right: 22px;
        // margin-top: 6px;
      }
      .Attorney-viexy3-text12 {
        flex: 1;
        flex-wrap: wrap;
        font-family: Source Han Sans SC;
        font-weight: 400;
        color: #2c2c2c;
      }
      .Attorney-viexy3-title {
        margin-top: -5px;
        margin-left: 11px;
        font-size: 18px;
        font-family: Source Han Sans SC;
        font-weight: 500;
        color: #000000;
        max-width: 360px;
        overflow: hidden; //超出的文本隐藏
        text-overflow: ellipsis; //溢出用省略号显示
        white-space: nowrap; //溢出不换行
      }
      .Attorney-viexy3-pap {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        width: 360px;
        // margin-top: 8px;
        margin-left: 11px;
        img {
          width: 24px;
          height: 24px;
          margin-top: 9px;
          margin-right: 5px;
        }
        .Attorney-viexy3-pap-score {
          padding: 0px 6px;
          display: flex;
          align-items: center;
          justify-content: center;
          // background: #f6e6e1;
          border-radius: 2px;
          font-size: 15px;
          font-family: Source Han Sans SC;
          font-weight: bold;
          color: #000000;
          height: 23px;
          margin-right: 0px;
          border-top-right-radius: 0;
          border-bottom-right-radius: 0;
          margin-top: 9px;
        }

        .Attorney-viexy3-pap-level {
          padding: 0px 6px;
          display: flex;
          align-items: center;
          justify-content: center;
          border-radius: 2px;
          font-size: 15px;
          font-family: Source Han Sans SC;
          font-weight: bold;
          height: 23px;
          color: #ffffff;
          margin-right: 10px;
          margin-top: 9px;
        }
        .Attorney-viexy3-view1 {
          display: flex;
          justify-content: center;
          align-items: center;
          height: 23px;
          padding: 0 9px;
          border-radius: 4px;
          font-size: 12px;
          font-family: Source Han Sans SC;
          font-weight: 400;
          margin-right: 10px;
          margin-top: 9px;
        }
        .level1 {
          background: #d0311a;
        }

        .level2 {
          background: #ee5941;
        }

        .level3 {
          background: #e7934d;
        }

        .level4 {
          background: #57b280;
        }

        .level5 {
          background: #4b98b7;
        }
        .level11 {
          background: rgba(246, 230, 225, 0.8);
        }

        .level22 {
          background: rgba(255, 236, 232, 0.8);
        }

        .level33 {
          background: rgba(255, 237, 221, 0.8);
        }

        .level44 {
          background: rgba(230, 239, 233, 0.8);
        }

        .level55 {
          background: rgba(224, 236, 240, 0.8);
        }

        .level66 {
          background: rgba(224, 236, 240, 0.8);
          margin-right: 21rpx;
        }
      }
    }
  }
  .Attorney-viexy3-viewapo {
    /* border: 1px solid red; */
    display: flex;
    height: 70px;
    /* padding: 25rpx; */
    text-align: center;
    align-items: center;
    justify-content: space-evenly;
    border-bottom: 1px solid #ececec;
    margin: 0 16px;
    .Attorney-name {
      font-size: 15px;
      font-family: Source Han Sans SC;
      font-weight: 400;
      color: #989898;
    }
    .Attorney-name-content {
      font-size: 15px;
      font-family: Source Han Sans SC;
      font-weight: 400;
      color: #2c2c2c;
    }
  }
  .Attorney-viexy3-ppoah {
    padding: 14px;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-family: Source Han Sans SC;
    font-weight: 400;
    color: #000000;
    img {
      width: 18px;
      height: 18px;
      margin-right: 4px;
    }
  }
  .score_A1 {
    background: #e7f3ea;
  }
  .score_A2 {
    background: #e7f3ea;
  }
  .score_A3 {
    background: #e7f3ea;
  }
  .score_B1 {
    background: #dceaf2;
  }
  .score_B2 {
    background: #dceaf2;
  }
  .score_B3 {
    background: #dceaf2;
  }
  .score_C1 {
    background: #f2ece6;
  }
  .score_C2 {
    background: #f2ece6;
  }
  .score_C3 {
    background: #f2ece6;
  }
  .score_D1 {
    background: #f3e9e8;
  }
  .score_D2 {
    background: #f3e9e8;
  }
  .score_D3 {
    background: #f3e9e8;
  }
  .level_A1 {
    background: #239d2c;
  }
  .level_A2 {
    background: #4cb369;
  }
  .level_A3 {
    background: #39b1ad;
  }
  .level_B1 {
    background: #20acc5;
  }
  .level_B2 {
    background: #36a2e7;
  }
  .level_B3 {
    background: #3888d9;
  }
  .level_C1 {
    background: #eba612;
  }
  .level_C2 {
    background: #f68f29;
  }
  .level_C3 {
    background: #f26e00;
  }
  .level_D1 {
    background: #f6622e;
  }
  .level_D2 {
    background: #f6622e;
  }
  .level_D3 {
    background: #d32d18;
  }
}
</style>
